home *** CD-ROM | disk | FTP | other *** search
-
- oldstring db ' '
- ;1234567890123456789012
- newstring db ' '
- db ' INSANE CREATORS '
- db ' ENTERPRISES '
- db ' PRESENTS '
- db ' THIS LITTLE DOT DEAL '
- db ' BY FRIAR TUCK '
- db ' ALL LETTER MUST BE '
- db ' IN CAPS AND THE ONLY '
- db ' PUNCTUATION IS .?! '
- db ' OH YEAH, AND SPACE '
- numstrings = 9
-
- curr_flip db 22 dup(10)
-
- linedone db 1
-
- char_loc label word
- ct=3228
- REPT 22
- dw ct
- ct=ct+FONT_XSIZE
- ENDM
-
- include font.asm
- include flip.dat
-
- @plotpoint macro
- push cx
- push di
- mov bx,ax
- mov cx,di
- and cx,3
- shr di,2
- mov ah,1
- shl ah,cl
- mov al,02
- mov dx,03C4h
- out dx,ax
- mov byte ptr es:[di],bl
- add di,80
- mov byte ptr es:[di],bl
- pop di
- pop cx
- endm @plotpoint
-
- nochar db 0
- ; DI = x/y location
- ; AX = char
- ; BX = flipline # (0-5)
- Write_char proc
- pusha
- mov cs:[nochar],0
- cmp al,'!'
- je wc00
- cmp al,' '
- je wc01
- cmp al,'?'
- je wc00a
- cmp al,'.'
- je wc00b
- cmp ax,65
- jl wc_exit
- cmp ax,90
- jg wc_exit
- sub ax,65
- jmp short wc02
- wc00a: mov ax,28
- jmp short wc02
- wc00b: mov ax,29
- jmp short wc02
- wc00: mov ax,26
- jmp short wc02
- wc01: mov ax,27
- wc02: mov cx,F_TOTALBYTES
- imul cx
- mov dx,ax
- add dx,offset FONT_A
- sal bx,5
- ;bx=proper flipline,dx=offset of font char
- mov cx,30
- wc03: push cx
- push di
- ;-----
- movzx ax,byte ptr cs:flipline[bx]
- mov cx,ax
- sal ax,3
- sal cx,2
- add ax,cx
- mov si,dx
- add si,ax
- push dx
- push bx
- mov cx,12
- wc04: mov al,byte ptr cs:[si]
- add al,80h
- @plotpoint ; plots al to es:[di]
- inc si
- inc di
- loop wc04
- pop bx
- pop dx
- inc bx
- pop di
- add di,640
- pop cx
- dec cx
- jnz wc03
- wc_exit:
- popa
- ret
- Write_char endp
-
- democount dd 0
- curr_char dw 65
-
- String_update proc
- mov eax,[democount]
- and ax,1
- jnz string_done
- mov cx,22
- xor bx,bx
- su00: push cx
- push bx
- mov al,byte ptr curr_flip[bx]
- cmp al,11
- je su_next;01a
- cmp al,24
- jl su01
- mov al,byte ptr newstring[bx]
- mov byte ptr oldstring[bx],al
- mov byte ptr curr_flip[bx],0
- jmp short su01a
- su01:
- inc byte ptr curr_flip[bx]
- su01a:
- movzx ax,byte ptr oldstring[bx]
- movzx dx,byte ptr curr_flip[bx]
- add bx,bx
- mov di,word ptr char_loc[bx]
- mov bx,dx
- call Write_char
- su_next:
- pop bx
- inc bx
- pop cx
- loop su00
- string_done:
- ret
- String_update endp
-
- writercount dd 0
-
- inc_string proc
- mov eax,[writercount]
- mov ebx,eax
- and ebx,15
- jnz is_done
- sar eax,4
- cmp eax,22
- setge [linedone]
- jge is_done
- mov bx,ax
- mov byte ptr curr_flip[bx],12
- is_done:
- ret
- inc_string endp
-
- strpointer dw offset newstring
-
- setstrings proc
- inc [writercount]
- cmp [linedone],1
- jne ss_exit
- add [strpointer],22
- mov si,[strpointer]
- mov di,offset newstring
- mov cx,11
- ss00: mov ax,word ptr ds:[si]
- mov word ptr ds:[di],ax
- add si,2
- add di,2
- loop ss00
- mov [linedone],0
- mov [writercount],0
- cmp [strpointer],offset newstring + 22*numstrings
- jne ss_exit
- mov [strpointer],offset newstring
- ss_exit:
- ret
- setstrings endp
-
- writer_init:
- ;Write the Palette
- mov dx,03C8h
- mov al,80h
- ; xor al,al
- out dx,al
- inc dx
- mov si,offset font_pal
- mov cx,9
- rep outsb
- ret
-
- do_writing:
- call setstrings
- call inc_string
- ; inc [democount]
- ;
- call String_update
- ret
-
-